﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace iWare.Wms.Database.Migrations.Migrations
{
    public partial class v102 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Wms_ContainerPlace_Wms_Container_WmsContainerId",
                table: "Wms_ContainerPlace");

            migrationBuilder.DropForeignKey(
                name: "FK_Wms_ContainerPlace_Wms_Place_WmsPlaceId",
                table: "Wms_ContainerPlace");

            migrationBuilder.DropForeignKey(
                name: "FK_Wms_MaterialContainer_Wms_Container_Containerid",
                table: "Wms_MaterialContainer");

            migrationBuilder.DropForeignKey(
                name: "FK_Wms_MaterialContainer_Wms_Material_Materialid",
                table: "Wms_MaterialContainer");

            migrationBuilder.DropForeignKey(
                name: "FK_Wms_Place_Wms_Area_Areaid",
                table: "Wms_Place");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_Task",
                table: "Wms_Task");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_Place",
                table: "Wms_Place");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_MaterialStock",
                table: "Wms_MaterialStock");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_MaterialContainer",
                table: "Wms_MaterialContainer");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_Material",
                table: "Wms_Material");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_ContainerPlace",
                table: "Wms_ContainerPlace");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_Container",
                table: "Wms_Container");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Wms_Area",
                table: "Wms_Area");

            migrationBuilder.DeleteData(
                table: "sys_role",
                keyColumn: "Id",
                keyValue: 142307070910555L);

            migrationBuilder.DeleteData(
                table: "sys_role",
                keyColumn: "Id",
                keyValue: 142307070910557L);

            migrationBuilder.DeleteData(
                table: "sys_user",
                keyColumn: "Id",
                keyValue: 142307070910553L);

            migrationBuilder.DeleteData(
                table: "sys_user",
                keyColumn: "Id",
                keyValue: 142307070910556L);

            migrationBuilder.DeleteData(
                table: "sys_user_role",
                keyColumns: new[] { "SysRoleId", "SysUserId" },
                keyValues: new object[] { 142307070910556L, 142307070910554L });

            migrationBuilder.DeleteData(
                table: "sys_role",
                keyColumn: "Id",
                keyValue: 142307070910556L);

            migrationBuilder.DeleteData(
                table: "sys_user",
                keyColumn: "Id",
                keyValue: 142307070910554L);

            migrationBuilder.DropColumn(
                name: "Handelstatus",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Iscurrenttask",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Isemptycontainer",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Islasttask",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Ordersid",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Taskcontentstring",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Void",
                table: "Wms_Task");

            migrationBuilder.DropColumn(
                name: "Aisleside",
                table: "Wms_Place");

            migrationBuilder.DropColumn(
                name: "Hastaskdoing",
                table: "Wms_Place");

            migrationBuilder.DropColumn(
                name: "Isfull",
                table: "Wms_Place");

            migrationBuilder.DropColumn(
                name: "Isemptycontainer",
                table: "Wms_MaterialContainer");

            migrationBuilder.DropColumn(
                name: "UserDefined01",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined02",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined03",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined04",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined05",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined06",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined07",
                table: "Wms_Material");

            migrationBuilder.DropColumn(
                name: "UserDefined08",
                table: "Wms_Material");

            migrationBuilder.RenameTable(
                name: "Wms_Task",
                newName: "wms_task");

            migrationBuilder.RenameTable(
                name: "Wms_Place",
                newName: "wms_place");

            migrationBuilder.RenameTable(
                name: "Wms_MaterialStock",
                newName: "wms_materialstock");

            migrationBuilder.RenameTable(
                name: "Wms_MaterialContainer",
                newName: "wms_materialcontainer");

            migrationBuilder.RenameTable(
                name: "Wms_Material",
                newName: "wms_material");

            migrationBuilder.RenameTable(
                name: "Wms_ContainerPlace",
                newName: "wms_containerplace");

            migrationBuilder.RenameTable(
                name: "Wms_Container",
                newName: "wms_container");

            migrationBuilder.RenameTable(
                name: "Wms_Area",
                newName: "wms_area");

            migrationBuilder.RenameColumn(
                name: "Toplace",
                table: "wms_task",
                newName: "ToPlace");

            migrationBuilder.RenameColumn(
                name: "Tasktype",
                table: "wms_task",
                newName: "TaskType");

            migrationBuilder.RenameColumn(
                name: "Taskstatus",
                table: "wms_task",
                newName: "TaskStatus");

            migrationBuilder.RenameColumn(
                name: "Taskno",
                table: "wms_task",
                newName: "TaskNo");

            migrationBuilder.RenameColumn(
                name: "Taskmodel",
                table: "wms_task",
                newName: "TaskModel");

            migrationBuilder.RenameColumn(
                name: "Tasklevel",
                table: "wms_task",
                newName: "TaskLevel");

            migrationBuilder.RenameColumn(
                name: "Sourceplace",
                table: "wms_task",
                newName: "SourcePlace");

            migrationBuilder.RenameColumn(
                name: "Sendtimes",
                table: "wms_task",
                newName: "SendTimes");

            migrationBuilder.RenameColumn(
                name: "Dodevicenodeid",
                table: "wms_task",
                newName: "DodevicenodeId");

            migrationBuilder.RenameColumn(
                name: "Dodeviceid",
                table: "wms_task",
                newName: "DodeviceId");

            migrationBuilder.RenameColumn(
                name: "emptyContainer",
                table: "wms_place",
                newName: "EmptyContainer");

            migrationBuilder.RenameColumn(
                name: "Rowno",
                table: "wms_place",
                newName: "RowNo");

            migrationBuilder.RenameColumn(
                name: "Placestatus",
                table: "wms_place",
                newName: "PlaceStatus");

            migrationBuilder.RenameColumn(
                name: "Placecode",
                table: "wms_place",
                newName: "PlaceCode");

            migrationBuilder.RenameColumn(
                name: "Maxweight",
                table: "wms_place",
                newName: "MaxWeight");

            migrationBuilder.RenameColumn(
                name: "Layerno",
                table: "wms_place",
                newName: "LayerNo");

            migrationBuilder.RenameColumn(
                name: "Heightlevel",
                table: "wms_place",
                newName: "HeightLevel");

            migrationBuilder.RenameColumn(
                name: "Deepcellno",
                table: "wms_place",
                newName: "DeepcellNo");

            migrationBuilder.RenameColumn(
                name: "Columnno",
                table: "wms_place",
                newName: "ColumnNo");

            migrationBuilder.RenameColumn(
                name: "Areaid",
                table: "wms_place",
                newName: "AreaId");

            migrationBuilder.RenameIndex(
                name: "IX_Wms_Place_Areaid",
                table: "wms_place",
                newName: "IX_wms_place_AreaId");

            migrationBuilder.RenameColumn(
                name: "Unittype",
                table: "wms_materialstock",
                newName: "UnitType");

            migrationBuilder.RenameColumn(
                name: "Unitno",
                table: "wms_materialstock",
                newName: "UnitNo");

            migrationBuilder.RenameColumn(
                name: "Stocknumber",
                table: "wms_materialstock",
                newName: "StockNumber");

            migrationBuilder.RenameColumn(
                name: "Placecode",
                table: "wms_materialstock",
                newName: "PlaceCode");

            migrationBuilder.RenameColumn(
                name: "Materialtype",
                table: "wms_materialstock",
                newName: "MaterialType");

            migrationBuilder.RenameColumn(
                name: "Materialspec",
                table: "wms_materialstock",
                newName: "MaterialSpec");

            migrationBuilder.RenameColumn(
                name: "Materialno",
                table: "wms_materialstock",
                newName: "MaterialNo");

            migrationBuilder.RenameColumn(
                name: "Materialname",
                table: "wms_materialstock",
                newName: "MaterialName");

            migrationBuilder.RenameColumn(
                name: "Materialbatch",
                table: "wms_materialstock",
                newName: "MaterialBatch");

            migrationBuilder.RenameColumn(
                name: "Inspectionmethod",
                table: "wms_materialstock",
                newName: "InspectionMethod");

            migrationBuilder.RenameColumn(
                name: "Containercode",
                table: "wms_materialstock",
                newName: "ContainerCode");

            migrationBuilder.RenameColumn(
                name: "Areaid",
                table: "wms_materialstock",
                newName: "AreaId");

            migrationBuilder.RenameColumn(
                name: "Sampleqty",
                table: "wms_materialcontainer",
                newName: "SampleQty");

            migrationBuilder.RenameColumn(
                name: "Materialspec",
                table: "wms_materialcontainer",
                newName: "MaterialSpec");

            migrationBuilder.RenameColumn(
                name: "Materialno",
                table: "wms_materialcontainer",
                newName: "MaterialNo");

            migrationBuilder.RenameColumn(
                name: "Materialname",
                table: "wms_materialcontainer",
                newName: "MaterialName");

            migrationBuilder.RenameColumn(
                name: "Materialid",
                table: "wms_materialcontainer",
                newName: "MaterialId");

            migrationBuilder.RenameColumn(
                name: "Materialbatch",
                table: "wms_materialcontainer",
                newName: "MaterialBatch");

            migrationBuilder.RenameColumn(
                name: "Containerid",
                table: "wms_materialcontainer",
                newName: "ContainerId");

            migrationBuilder.RenameColumn(
                name: "Containercode",
                table: "wms_materialcontainer",
                newName: "ContainerCode");

            migrationBuilder.RenameColumn(
                name: "Bindstatus",
                table: "wms_materialcontainer",
                newName: "BindStatus");

            migrationBuilder.RenameColumn(
                name: "Bindquantity",
                table: "wms_materialcontainer",
                newName: "BindQuantity");

            migrationBuilder.RenameIndex(
                name: "IX_Wms_MaterialContainer_Materialid",
                table: "wms_materialcontainer",
                newName: "IX_wms_materialcontainer_MaterialId");

            migrationBuilder.RenameIndex(
                name: "IX_Wms_MaterialContainer_Containerid",
                table: "wms_materialcontainer",
                newName: "IX_wms_materialcontainer_ContainerId");

            migrationBuilder.RenameColumn(
                name: "Unittype",
                table: "wms_material",
                newName: "UnitType");

            migrationBuilder.RenameColumn(
                name: "Unitno",
                table: "wms_material",
                newName: "UnitNo");

            migrationBuilder.RenameColumn(
                name: "Minstorageage",
                table: "wms_material",
                newName: "MinstorageAge");

            migrationBuilder.RenameColumn(
                name: "Maxstorageage",
                table: "wms_material",
                newName: "MaxstorageAge");

            migrationBuilder.RenameColumn(
                name: "Maximumqty",
                table: "wms_material",
                newName: "MaxImumqty");

            migrationBuilder.RenameColumn(
                name: "Materialtype",
                table: "wms_material",
                newName: "MaterialType");

            migrationBuilder.RenameColumn(
                name: "Materialspec",
                table: "wms_material",
                newName: "MaterialSpec");

            migrationBuilder.RenameColumn(
                name: "Materialno",
                table: "wms_material",
                newName: "MaterialNo");

            migrationBuilder.RenameColumn(
                name: "Materialname",
                table: "wms_material",
                newName: "MaterialName");

            migrationBuilder.RenameColumn(
                name: "Materialbatch",
                table: "wms_material",
                newName: "MaterialBatch");

            migrationBuilder.RenameColumn(
                name: "Inspectionmethod",
                table: "wms_material",
                newName: "InspectionMethod");

            migrationBuilder.RenameColumn(
                name: "Graphno",
                table: "wms_material",
                newName: "GraphNo");

            migrationBuilder.RenameColumn(
                name: "Erpno",
                table: "wms_material",
                newName: "ErpNo");

            migrationBuilder.RenameColumn(
                name: "Placeid",
                table: "wms_containerplace",
                newName: "PlaceId");

            migrationBuilder.RenameColumn(
                name: "Placecode",
                table: "wms_containerplace",
                newName: "PlaceCode");

            migrationBuilder.RenameColumn(
                name: "Containerplacestatus",
                table: "wms_containerplace",
                newName: "ContainerPlaceStatus");

            migrationBuilder.RenameColumn(
                name: "Containerid",
                table: "wms_containerplace",
                newName: "ContainerId");

            migrationBuilder.RenameColumn(
                name: "Containercode",
                table: "wms_containerplace",
                newName: "ContainerCode");

            migrationBuilder.RenameIndex(
                name: "IX_Wms_ContainerPlace_WmsPlaceId",
                table: "wms_containerplace",
                newName: "IX_wms_containerplace_WmsPlaceId");

            migrationBuilder.RenameIndex(
                name: "IX_Wms_ContainerPlace_WmsContainerId",
                table: "wms_containerplace",
                newName: "IX_wms_containerplace_WmsContainerId");

            migrationBuilder.RenameColumn(
                name: "Specwidth",
                table: "wms_container",
                newName: "SpecWidth");

            migrationBuilder.RenameColumn(
                name: "Speclength",
                table: "wms_container",
                newName: "SpecLength");

            migrationBuilder.RenameColumn(
                name: "Specheight",
                table: "wms_container",
                newName: "SpecHeight");

            migrationBuilder.RenameColumn(
                name: "Parentcontainerid",
                table: "wms_container",
                newName: "ParentContainerId");

            migrationBuilder.RenameColumn(
                name: "Maxweight",
                table: "wms_container",
                newName: "MaxWeight");

            migrationBuilder.RenameColumn(
                name: "Limitwidth",
                table: "wms_container",
                newName: "LimitWidth");

            migrationBuilder.RenameColumn(
                name: "Limitlength",
                table: "wms_container",
                newName: "LimitLength");

            migrationBuilder.RenameColumn(
                name: "Limitheight",
                table: "wms_container",
                newName: "LimitHeight");

            migrationBuilder.RenameColumn(
                name: "Containertype",
                table: "wms_container",
                newName: "ContainerType");

            migrationBuilder.RenameColumn(
                name: "Containerstatus",
                table: "wms_container",
                newName: "ContainerStatus");

            migrationBuilder.RenameColumn(
                name: "Containercode",
                table: "wms_container",
                newName: "ContainerCode");

            migrationBuilder.RenameColumn(
                name: "Areatype",
                table: "wms_area",
                newName: "AreaType");

            migrationBuilder.RenameColumn(
                name: "Areastatus",
                table: "wms_area",
                newName: "AreaStatus");

            migrationBuilder.RenameColumn(
                name: "Areaname",
                table: "wms_area",
                newName: "AreaName");

            migrationBuilder.RenameColumn(
                name: "Areadesc",
                table: "wms_area",
                newName: "AreaDesc");

            migrationBuilder.AlterTable(
                name: "wms_place",
                comment: "库位",
                oldComment: "库位信息");

            migrationBuilder.AlterTable(
                name: "wms_containerplace",
                comment: "托盘库位关系表",
                oldComment: "容器库位关系表");

            migrationBuilder.AlterTable(
                name: "wms_area",
                comment: "库区",
                oldComment: "库区信息");

            migrationBuilder.AlterColumn<string>(
                name: "ToPlace",
                table: "wms_task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "目标库位",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "目标库位");

            migrationBuilder.AlterColumn<string>(
                name: "SourcePlace",
                table: "wms_task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "起始库位",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "起始库位");

            migrationBuilder.AlterColumn<string>(
                name: "ContainerCode",
                table: "wms_task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "托盘编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "托盘编号");

            migrationBuilder.AlterColumn<string>(
                name: "AreaName",
                table: "wms_task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "库区名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库区名称");

            migrationBuilder.AddColumn<string>(
                name: "OrderNo",
                table: "wms_task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "组盘记录ID");

            migrationBuilder.AlterColumn<string>(
                name: "Zzb",
                table: "wms_place",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库位Z坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "库位Z坐标");

            migrationBuilder.AlterColumn<string>(
                name: "Yzb",
                table: "wms_place",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库位Y坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "库位Y坐标");

            migrationBuilder.AlterColumn<string>(
                name: "Xzb",
                table: "wms_place",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库位X坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "库位X坐标");

            migrationBuilder.AlterColumn<string>(
                name: "PositionnoForSrm",
                table: "wms_place",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "堆垛机内部的位置",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldNullable: true,
                oldComment: "堆垛机内部的位置");

            migrationBuilder.AlterColumn<string>(
                name: "MaterialSpec",
                table: "wms_materialstock",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "物料规格",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "物料规格");

            migrationBuilder.AlterColumn<string>(
                name: "OrderNo",
                table: "wms_materialcontainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "单号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "单号");

            migrationBuilder.AlterColumn<string>(
                name: "MaterialSpec",
                table: "wms_materialcontainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "物料规格",
                oldClrType: typeof(string),
                oldType: "nvarchar(150)",
                oldMaxLength: 150,
                oldNullable: true,
                oldComment: "物料规格");

            migrationBuilder.AlterColumn<string>(
                name: "MaterialNo",
                table: "wms_materialcontainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "物料编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "物料编号");

            migrationBuilder.AlterColumn<string>(
                name: "MaterialName",
                table: "wms_materialcontainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "物料名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "物料名称");

            migrationBuilder.AlterColumn<long>(
                name: "MaterialId",
                table: "wms_materialcontainer",
                type: "bigint",
                nullable: false,
                defaultValue: 0L,
                comment: "物料ID",
                oldClrType: typeof(long),
                oldType: "bigint",
                oldNullable: true,
                oldComment: "物料ID");

            migrationBuilder.AlterColumn<int>(
                name: "BindStatus",
                table: "wms_materialcontainer",
                type: "int",
                nullable: false,
                comment: "组盘状态",
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "物料规格");

            migrationBuilder.AlterColumn<decimal>(
                name: "Warranty",
                table: "wms_material",
                type: "decimal(18,2)",
                nullable: false,
                comment: "保质期",
                oldClrType: typeof(float),
                oldType: "real",
                oldComment: "保质期");

            migrationBuilder.AlterColumn<decimal>(
                name: "MinstorageAge",
                table: "wms_material",
                type: "decimal(18,2)",
                nullable: false,
                comment: "最小库龄",
                oldClrType: typeof(float),
                oldType: "real",
                oldComment: "最小库龄");

            migrationBuilder.AlterColumn<decimal>(
                name: "MaxstorageAge",
                table: "wms_material",
                type: "decimal(18,2)",
                nullable: false,
                comment: "最大库龄",
                oldClrType: typeof(float),
                oldType: "real",
                oldComment: "最大库龄");

            migrationBuilder.AlterColumn<decimal>(
                name: "MaxImumqty",
                table: "wms_material",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m,
                comment: "最大存量",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldNullable: true,
                oldComment: "最大存量");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "wms_material",
                type: "nvarchar(500)",
                maxLength: 500,
                nullable: true,
                comment: "描述",
                oldClrType: typeof(string),
                oldType: "nvarchar(250)",
                oldMaxLength: 250,
                oldNullable: true,
                oldComment: "描述");

            migrationBuilder.AlterColumn<string>(
                name: "PlaceCode",
                table: "wms_containerplace",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "库位编码",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库位编码");

            migrationBuilder.AlterColumn<string>(
                name: "ContainerCode",
                table: "wms_containerplace",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "库位编码",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库位编码");

            migrationBuilder.AlterColumn<string>(
                name: "ContainerCode",
                table: "wms_container",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                comment: "编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20,
                oldComment: "编号");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_task",
                table: "wms_task",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_place",
                table: "wms_place",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_materialstock",
                table: "wms_materialstock",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_materialcontainer",
                table: "wms_materialcontainer",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_material",
                table: "wms_material",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_containerplace",
                table: "wms_containerplace",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_container",
                table: "wms_container",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_wms_area",
                table: "wms_area",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_wms_containerplace_wms_container_WmsContainerId",
                table: "wms_containerplace",
                column: "WmsContainerId",
                principalTable: "wms_container",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_wms_containerplace_wms_place_WmsPlaceId",
                table: "wms_containerplace",
                column: "WmsPlaceId",
                principalTable: "wms_place",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_wms_materialcontainer_wms_container_ContainerId",
                table: "wms_materialcontainer",
                column: "ContainerId",
                principalTable: "wms_container",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_wms_materialcontainer_wms_material_MaterialId",
                table: "wms_materialcontainer",
                column: "MaterialId",
                principalTable: "wms_material",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_wms_place_wms_area_AreaId",
                table: "wms_place",
                column: "AreaId",
                principalTable: "wms_area",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_wms_containerplace_wms_container_WmsContainerId",
                table: "wms_containerplace");

            migrationBuilder.DropForeignKey(
                name: "FK_wms_containerplace_wms_place_WmsPlaceId",
                table: "wms_containerplace");

            migrationBuilder.DropForeignKey(
                name: "FK_wms_materialcontainer_wms_container_ContainerId",
                table: "wms_materialcontainer");

            migrationBuilder.DropForeignKey(
                name: "FK_wms_materialcontainer_wms_material_MaterialId",
                table: "wms_materialcontainer");

            migrationBuilder.DropForeignKey(
                name: "FK_wms_place_wms_area_AreaId",
                table: "wms_place");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_task",
                table: "wms_task");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_place",
                table: "wms_place");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_materialstock",
                table: "wms_materialstock");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_materialcontainer",
                table: "wms_materialcontainer");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_material",
                table: "wms_material");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_containerplace",
                table: "wms_containerplace");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_container",
                table: "wms_container");

            migrationBuilder.DropPrimaryKey(
                name: "PK_wms_area",
                table: "wms_area");

            migrationBuilder.DropColumn(
                name: "OrderNo",
                table: "wms_task");

            migrationBuilder.RenameTable(
                name: "wms_task",
                newName: "Wms_Task");

            migrationBuilder.RenameTable(
                name: "wms_place",
                newName: "Wms_Place");

            migrationBuilder.RenameTable(
                name: "wms_materialstock",
                newName: "Wms_MaterialStock");

            migrationBuilder.RenameTable(
                name: "wms_materialcontainer",
                newName: "Wms_MaterialContainer");

            migrationBuilder.RenameTable(
                name: "wms_material",
                newName: "Wms_Material");

            migrationBuilder.RenameTable(
                name: "wms_containerplace",
                newName: "Wms_ContainerPlace");

            migrationBuilder.RenameTable(
                name: "wms_container",
                newName: "Wms_Container");

            migrationBuilder.RenameTable(
                name: "wms_area",
                newName: "Wms_Area");

            migrationBuilder.RenameColumn(
                name: "ToPlace",
                table: "Wms_Task",
                newName: "Toplace");

            migrationBuilder.RenameColumn(
                name: "TaskType",
                table: "Wms_Task",
                newName: "Tasktype");

            migrationBuilder.RenameColumn(
                name: "TaskStatus",
                table: "Wms_Task",
                newName: "Taskstatus");

            migrationBuilder.RenameColumn(
                name: "TaskNo",
                table: "Wms_Task",
                newName: "Taskno");

            migrationBuilder.RenameColumn(
                name: "TaskModel",
                table: "Wms_Task",
                newName: "Taskmodel");

            migrationBuilder.RenameColumn(
                name: "TaskLevel",
                table: "Wms_Task",
                newName: "Tasklevel");

            migrationBuilder.RenameColumn(
                name: "SourcePlace",
                table: "Wms_Task",
                newName: "Sourceplace");

            migrationBuilder.RenameColumn(
                name: "SendTimes",
                table: "Wms_Task",
                newName: "Sendtimes");

            migrationBuilder.RenameColumn(
                name: "DodevicenodeId",
                table: "Wms_Task",
                newName: "Dodevicenodeid");

            migrationBuilder.RenameColumn(
                name: "DodeviceId",
                table: "Wms_Task",
                newName: "Dodeviceid");

            migrationBuilder.RenameColumn(
                name: "RowNo",
                table: "Wms_Place",
                newName: "Rowno");

            migrationBuilder.RenameColumn(
                name: "PlaceStatus",
                table: "Wms_Place",
                newName: "Placestatus");

            migrationBuilder.RenameColumn(
                name: "PlaceCode",
                table: "Wms_Place",
                newName: "Placecode");

            migrationBuilder.RenameColumn(
                name: "MaxWeight",
                table: "Wms_Place",
                newName: "Maxweight");

            migrationBuilder.RenameColumn(
                name: "LayerNo",
                table: "Wms_Place",
                newName: "Layerno");

            migrationBuilder.RenameColumn(
                name: "HeightLevel",
                table: "Wms_Place",
                newName: "Heightlevel");

            migrationBuilder.RenameColumn(
                name: "EmptyContainer",
                table: "Wms_Place",
                newName: "emptyContainer");

            migrationBuilder.RenameColumn(
                name: "DeepcellNo",
                table: "Wms_Place",
                newName: "Deepcellno");

            migrationBuilder.RenameColumn(
                name: "ColumnNo",
                table: "Wms_Place",
                newName: "Columnno");

            migrationBuilder.RenameColumn(
                name: "AreaId",
                table: "Wms_Place",
                newName: "Areaid");

            migrationBuilder.RenameIndex(
                name: "IX_wms_place_AreaId",
                table: "Wms_Place",
                newName: "IX_Wms_Place_Areaid");

            migrationBuilder.RenameColumn(
                name: "UnitType",
                table: "Wms_MaterialStock",
                newName: "Unittype");

            migrationBuilder.RenameColumn(
                name: "UnitNo",
                table: "Wms_MaterialStock",
                newName: "Unitno");

            migrationBuilder.RenameColumn(
                name: "StockNumber",
                table: "Wms_MaterialStock",
                newName: "Stocknumber");

            migrationBuilder.RenameColumn(
                name: "PlaceCode",
                table: "Wms_MaterialStock",
                newName: "Placecode");

            migrationBuilder.RenameColumn(
                name: "MaterialType",
                table: "Wms_MaterialStock",
                newName: "Materialtype");

            migrationBuilder.RenameColumn(
                name: "MaterialSpec",
                table: "Wms_MaterialStock",
                newName: "Materialspec");

            migrationBuilder.RenameColumn(
                name: "MaterialNo",
                table: "Wms_MaterialStock",
                newName: "Materialno");

            migrationBuilder.RenameColumn(
                name: "MaterialName",
                table: "Wms_MaterialStock",
                newName: "Materialname");

            migrationBuilder.RenameColumn(
                name: "MaterialBatch",
                table: "Wms_MaterialStock",
                newName: "Materialbatch");

            migrationBuilder.RenameColumn(
                name: "InspectionMethod",
                table: "Wms_MaterialStock",
                newName: "Inspectionmethod");

            migrationBuilder.RenameColumn(
                name: "ContainerCode",
                table: "Wms_MaterialStock",
                newName: "Containercode");

            migrationBuilder.RenameColumn(
                name: "AreaId",
                table: "Wms_MaterialStock",
                newName: "Areaid");

            migrationBuilder.RenameColumn(
                name: "SampleQty",
                table: "Wms_MaterialContainer",
                newName: "Sampleqty");

            migrationBuilder.RenameColumn(
                name: "MaterialSpec",
                table: "Wms_MaterialContainer",
                newName: "Materialspec");

            migrationBuilder.RenameColumn(
                name: "MaterialNo",
                table: "Wms_MaterialContainer",
                newName: "Materialno");

            migrationBuilder.RenameColumn(
                name: "MaterialName",
                table: "Wms_MaterialContainer",
                newName: "Materialname");

            migrationBuilder.RenameColumn(
                name: "MaterialId",
                table: "Wms_MaterialContainer",
                newName: "Materialid");

            migrationBuilder.RenameColumn(
                name: "MaterialBatch",
                table: "Wms_MaterialContainer",
                newName: "Materialbatch");

            migrationBuilder.RenameColumn(
                name: "ContainerId",
                table: "Wms_MaterialContainer",
                newName: "Containerid");

            migrationBuilder.RenameColumn(
                name: "ContainerCode",
                table: "Wms_MaterialContainer",
                newName: "Containercode");

            migrationBuilder.RenameColumn(
                name: "BindStatus",
                table: "Wms_MaterialContainer",
                newName: "Bindstatus");

            migrationBuilder.RenameColumn(
                name: "BindQuantity",
                table: "Wms_MaterialContainer",
                newName: "Bindquantity");

            migrationBuilder.RenameIndex(
                name: "IX_wms_materialcontainer_MaterialId",
                table: "Wms_MaterialContainer",
                newName: "IX_Wms_MaterialContainer_Materialid");

            migrationBuilder.RenameIndex(
                name: "IX_wms_materialcontainer_ContainerId",
                table: "Wms_MaterialContainer",
                newName: "IX_Wms_MaterialContainer_Containerid");

            migrationBuilder.RenameColumn(
                name: "UnitType",
                table: "Wms_Material",
                newName: "Unittype");

            migrationBuilder.RenameColumn(
                name: "UnitNo",
                table: "Wms_Material",
                newName: "Unitno");

            migrationBuilder.RenameColumn(
                name: "MinstorageAge",
                table: "Wms_Material",
                newName: "Minstorageage");

            migrationBuilder.RenameColumn(
                name: "MaxstorageAge",
                table: "Wms_Material",
                newName: "Maxstorageage");

            migrationBuilder.RenameColumn(
                name: "MaxImumqty",
                table: "Wms_Material",
                newName: "Maximumqty");

            migrationBuilder.RenameColumn(
                name: "MaterialType",
                table: "Wms_Material",
                newName: "Materialtype");

            migrationBuilder.RenameColumn(
                name: "MaterialSpec",
                table: "Wms_Material",
                newName: "Materialspec");

            migrationBuilder.RenameColumn(
                name: "MaterialNo",
                table: "Wms_Material",
                newName: "Materialno");

            migrationBuilder.RenameColumn(
                name: "MaterialName",
                table: "Wms_Material",
                newName: "Materialname");

            migrationBuilder.RenameColumn(
                name: "MaterialBatch",
                table: "Wms_Material",
                newName: "Materialbatch");

            migrationBuilder.RenameColumn(
                name: "InspectionMethod",
                table: "Wms_Material",
                newName: "Inspectionmethod");

            migrationBuilder.RenameColumn(
                name: "GraphNo",
                table: "Wms_Material",
                newName: "Graphno");

            migrationBuilder.RenameColumn(
                name: "ErpNo",
                table: "Wms_Material",
                newName: "Erpno");

            migrationBuilder.RenameColumn(
                name: "PlaceId",
                table: "Wms_ContainerPlace",
                newName: "Placeid");

            migrationBuilder.RenameColumn(
                name: "PlaceCode",
                table: "Wms_ContainerPlace",
                newName: "Placecode");

            migrationBuilder.RenameColumn(
                name: "ContainerPlaceStatus",
                table: "Wms_ContainerPlace",
                newName: "Containerplacestatus");

            migrationBuilder.RenameColumn(
                name: "ContainerId",
                table: "Wms_ContainerPlace",
                newName: "Containerid");

            migrationBuilder.RenameColumn(
                name: "ContainerCode",
                table: "Wms_ContainerPlace",
                newName: "Containercode");

            migrationBuilder.RenameIndex(
                name: "IX_wms_containerplace_WmsPlaceId",
                table: "Wms_ContainerPlace",
                newName: "IX_Wms_ContainerPlace_WmsPlaceId");

            migrationBuilder.RenameIndex(
                name: "IX_wms_containerplace_WmsContainerId",
                table: "Wms_ContainerPlace",
                newName: "IX_Wms_ContainerPlace_WmsContainerId");

            migrationBuilder.RenameColumn(
                name: "SpecWidth",
                table: "Wms_Container",
                newName: "Specwidth");

            migrationBuilder.RenameColumn(
                name: "SpecLength",
                table: "Wms_Container",
                newName: "Speclength");

            migrationBuilder.RenameColumn(
                name: "SpecHeight",
                table: "Wms_Container",
                newName: "Specheight");

            migrationBuilder.RenameColumn(
                name: "ParentContainerId",
                table: "Wms_Container",
                newName: "Parentcontainerid");

            migrationBuilder.RenameColumn(
                name: "MaxWeight",
                table: "Wms_Container",
                newName: "Maxweight");

            migrationBuilder.RenameColumn(
                name: "LimitWidth",
                table: "Wms_Container",
                newName: "Limitwidth");

            migrationBuilder.RenameColumn(
                name: "LimitLength",
                table: "Wms_Container",
                newName: "Limitlength");

            migrationBuilder.RenameColumn(
                name: "LimitHeight",
                table: "Wms_Container",
                newName: "Limitheight");

            migrationBuilder.RenameColumn(
                name: "ContainerType",
                table: "Wms_Container",
                newName: "Containertype");

            migrationBuilder.RenameColumn(
                name: "ContainerStatus",
                table: "Wms_Container",
                newName: "Containerstatus");

            migrationBuilder.RenameColumn(
                name: "ContainerCode",
                table: "Wms_Container",
                newName: "Containercode");

            migrationBuilder.RenameColumn(
                name: "AreaType",
                table: "Wms_Area",
                newName: "Areatype");

            migrationBuilder.RenameColumn(
                name: "AreaStatus",
                table: "Wms_Area",
                newName: "Areastatus");

            migrationBuilder.RenameColumn(
                name: "AreaName",
                table: "Wms_Area",
                newName: "Areaname");

            migrationBuilder.RenameColumn(
                name: "AreaDesc",
                table: "Wms_Area",
                newName: "Areadesc");

            migrationBuilder.AlterTable(
                name: "Wms_Place",
                comment: "库位信息",
                oldComment: "库位");

            migrationBuilder.AlterTable(
                name: "Wms_ContainerPlace",
                comment: "容器库位关系表",
                oldComment: "托盘库位关系表");

            migrationBuilder.AlterTable(
                name: "Wms_Area",
                comment: "库区信息",
                oldComment: "库区");

            migrationBuilder.AlterColumn<string>(
                name: "Toplace",
                table: "Wms_Task",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "目标库位",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "目标库位");

            migrationBuilder.AlterColumn<string>(
                name: "Sourceplace",
                table: "Wms_Task",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "起始库位",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "起始库位");

            migrationBuilder.AlterColumn<string>(
                name: "ContainerCode",
                table: "Wms_Task",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "托盘编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "托盘编号");

            migrationBuilder.AlterColumn<string>(
                name: "AreaName",
                table: "Wms_Task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库区名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "库区名称");

            migrationBuilder.AddColumn<int>(
                name: "Handelstatus",
                table: "Wms_Task",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "任务处理状态");

            migrationBuilder.AddColumn<int>(
                name: "Iscurrenttask",
                table: "Wms_Task",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "正在执行的任务");

            migrationBuilder.AddColumn<int>(
                name: "Isemptycontainer",
                table: "Wms_Task",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "正在执行的任务");

            migrationBuilder.AddColumn<int>(
                name: "Islasttask",
                table: "Wms_Task",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "是否是最后执行的任务");

            migrationBuilder.AddColumn<string>(
                name: "Ordersid",
                table: "Wms_Task",
                type: "nvarchar(max)",
                nullable: true,
                comment: "组盘记录ID");

            migrationBuilder.AddColumn<string>(
                name: "Taskcontentstring",
                table: "Wms_Task",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "任务状态");

            migrationBuilder.AddColumn<int>(
                name: "Void",
                table: "Wms_Task",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "是否生效");

            migrationBuilder.AlterColumn<string>(
                name: "Zzb",
                table: "Wms_Place",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "库位Z坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库位Z坐标");

            migrationBuilder.AlterColumn<string>(
                name: "Yzb",
                table: "Wms_Place",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "库位Y坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库位Y坐标");

            migrationBuilder.AlterColumn<string>(
                name: "Xzb",
                table: "Wms_Place",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "库位X坐标",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "库位X坐标");

            migrationBuilder.AlterColumn<string>(
                name: "PositionnoForSrm",
                table: "Wms_Place",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "堆垛机内部的位置",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "堆垛机内部的位置");

            migrationBuilder.AddColumn<string>(
                name: "Aisleside",
                table: "Wms_Place",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true,
                comment: "巷道左右");

            migrationBuilder.AddColumn<int>(
                name: "Hastaskdoing",
                table: "Wms_Place",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "否正在操作");

            migrationBuilder.AddColumn<int>(
                name: "Isfull",
                table: "Wms_Place",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<string>(
                name: "Materialspec",
                table: "Wms_MaterialStock",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "",
                comment: "物料规格",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "物料规格");

            migrationBuilder.AlterColumn<string>(
                name: "OrderNo",
                table: "Wms_MaterialContainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "单号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "单号");

            migrationBuilder.AlterColumn<string>(
                name: "Materialspec",
                table: "Wms_MaterialContainer",
                type: "nvarchar(150)",
                maxLength: 150,
                nullable: true,
                comment: "物料规格",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true,
                oldComment: "物料规格");

            migrationBuilder.AlterColumn<string>(
                name: "Materialno",
                table: "Wms_MaterialContainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "物料编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "物料编号");

            migrationBuilder.AlterColumn<string>(
                name: "Materialname",
                table: "Wms_MaterialContainer",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "物料名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "物料名称");

            migrationBuilder.AlterColumn<long>(
                name: "Materialid",
                table: "Wms_MaterialContainer",
                type: "bigint",
                nullable: true,
                comment: "物料ID",
                oldClrType: typeof(long),
                oldType: "bigint",
                oldComment: "物料ID");

            migrationBuilder.AlterColumn<int>(
                name: "Bindstatus",
                table: "Wms_MaterialContainer",
                type: "int",
                nullable: false,
                comment: "物料规格",
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "组盘状态");

            migrationBuilder.AddColumn<int>(
                name: "Isemptycontainer",
                table: "Wms_MaterialContainer",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "是否空托");

            migrationBuilder.AlterColumn<float>(
                name: "Warranty",
                table: "Wms_Material",
                type: "real",
                nullable: false,
                comment: "保质期",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldComment: "保质期");

            migrationBuilder.AlterColumn<float>(
                name: "Minstorageage",
                table: "Wms_Material",
                type: "real",
                nullable: false,
                comment: "最小库龄",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldComment: "最小库龄");

            migrationBuilder.AlterColumn<float>(
                name: "Maxstorageage",
                table: "Wms_Material",
                type: "real",
                nullable: false,
                comment: "最大库龄",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldComment: "最大库龄");

            migrationBuilder.AlterColumn<decimal>(
                name: "Maximumqty",
                table: "Wms_Material",
                type: "decimal(18,2)",
                nullable: true,
                comment: "最大存量",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldComment: "最大存量");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "Wms_Material",
                type: "nvarchar(250)",
                maxLength: 250,
                nullable: true,
                comment: "描述",
                oldClrType: typeof(string),
                oldType: "nvarchar(500)",
                oldMaxLength: 500,
                oldNullable: true,
                oldComment: "描述");

            migrationBuilder.AddColumn<string>(
                name: "UserDefined01",
                table: "Wms_Material",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "用户自定义字段02");

            migrationBuilder.AddColumn<string>(
                name: "UserDefined02",
                table: "Wms_Material",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "用户自定义字段02");

            migrationBuilder.AddColumn<float>(
                name: "UserDefined03",
                table: "Wms_Material",
                type: "real",
                nullable: false,
                defaultValue: 0f);

            migrationBuilder.AddColumn<float>(
                name: "UserDefined04",
                table: "Wms_Material",
                type: "real",
                nullable: false,
                defaultValue: 0f);

            migrationBuilder.AddColumn<decimal>(
                name: "UserDefined05",
                table: "Wms_Material",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "UserDefined06",
                table: "Wms_Material",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "UserDefined07",
                table: "Wms_Material",
                type: "datetimeoffset",
                nullable: true);

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "UserDefined08",
                table: "Wms_Material",
                type: "datetimeoffset",
                nullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "Placecode",
                table: "Wms_ContainerPlace",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库位编码",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "库位编码");

            migrationBuilder.AlterColumn<string>(
                name: "Containercode",
                table: "Wms_ContainerPlace",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                comment: "库位编码",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "库位编码");

            migrationBuilder.AlterColumn<string>(
                name: "Containercode",
                table: "Wms_Container",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: false,
                comment: "编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldComment: "编号");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_Task",
                table: "Wms_Task",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_Place",
                table: "Wms_Place",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_MaterialStock",
                table: "Wms_MaterialStock",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_MaterialContainer",
                table: "Wms_MaterialContainer",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_Material",
                table: "Wms_Material",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_ContainerPlace",
                table: "Wms_ContainerPlace",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_Container",
                table: "Wms_Container",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Wms_Area",
                table: "Wms_Area",
                column: "Id");

            migrationBuilder.InsertData(
                table: "sys_role",
                columns: new[] { "Id", "Code", "CreatedTime", "CreatedUserId", "CreatedUserName", "DataScopeType", "IsDeleted", "Name", "Remark", "RoleType", "Sort", "Status", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" },
                values: new object[,]
                {
                    { 142307070910555L, "common_role", null, null, null, 5, false, "普通用户", "普通用户", 0, 101, 0, null, null, null },
                    { 142307070910556L, "sys_manager_role", null, null, null, 5, false, "系统管理员", "系统管理员", 0, 100, 0, null, null, null },
                    { 142307070910557L, "common_role", null, null, null, 5, false, "普通用户", "普通用户", 0, 101, 0, null, null, null }
                });

            migrationBuilder.InsertData(
                table: "sys_user",
                columns: new[] { "Id", "Account", "AdminType", "Avatar", "Birthday", "CreatedTime", "CreatedUserId", "CreatedUserName", "Email", "IsDeleted", "LastLoginIp", "LastLoginTime", "Name", "NickName", "Password", "Phone", "Sex", "Status", "Tel", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" },
                values: new object[,]
                {
                    { 142307070910553L, "zuohuaijun", 3, null, new DateTimeOffset(new DateTime(1986, 7, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, false, null, null, "普通用户", "zuohuaijun", "e10adc3949ba59abbe56e057f20f883e", "18020030720", 1, 0, null, null, null, null },
                    { 142307070910554L, "zuohuaijun@163.com", 2, null, new DateTimeOffset(new DateTime(1986, 7, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, false, null, null, "系统管理员", "admin", "e10adc3949ba59abbe56e057f20f883e", "18020030720", 1, 0, null, null, null, null },
                    { 142307070910556L, "dilon@163.com", 3, null, new DateTimeOffset(new DateTime(1986, 7, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, false, null, null, "普通用户", "dilon", "e10adc3949ba59abbe56e057f20f883e", "18020030720", 1, 0, null, null, null, null }
                });

            migrationBuilder.InsertData(
                table: "sys_user_role",
                columns: new[] { "SysRoleId", "SysUserId" },
                values: new object[] { 142307070910556L, 142307070910554L });

            migrationBuilder.AddForeignKey(
                name: "FK_Wms_ContainerPlace_Wms_Container_WmsContainerId",
                table: "Wms_ContainerPlace",
                column: "WmsContainerId",
                principalTable: "Wms_Container",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Wms_ContainerPlace_Wms_Place_WmsPlaceId",
                table: "Wms_ContainerPlace",
                column: "WmsPlaceId",
                principalTable: "Wms_Place",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Wms_MaterialContainer_Wms_Container_Containerid",
                table: "Wms_MaterialContainer",
                column: "Containerid",
                principalTable: "Wms_Container",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Wms_MaterialContainer_Wms_Material_Materialid",
                table: "Wms_MaterialContainer",
                column: "Materialid",
                principalTable: "Wms_Material",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Wms_Place_Wms_Area_Areaid",
                table: "Wms_Place",
                column: "Areaid",
                principalTable: "Wms_Area",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
